import {take,call,put,fork} from 'redux-saga/effects';
import getRecommendData from '../servers/serRecommend';
function *sagWatchRecommend() {
    while (true){
        let action=yield take('RECOMMEND');
        console.log()
        let payload=yield call(getRecommendData);
        let temPayload=[];
        if(payload.code===200){
            temPayload=payload.data
        };
        yield put({type:'recommend',data:{aRecommend:temPayload}})
        if(action.data.success()){
            action.data.success()
        }
    }
}
export default [
    fork(sagWatchRecommend)
]